﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BitTorrentSharp.Client
{
	/// <summary>
	/// Pepresent as a message parser that convert <see cref="RawMessage"/> to <see cref="PeerMessage"/>.
	/// </summary>
	public abstract class MessageParser
	{
		/// <summary>
		/// When overrided in a derived class, it's used to parse a raw message to a peer message.
		/// </summary>
		/// <param name="rawMessage">The raw message to be parsing.</param>
		/// <returns>The parsed peer message, or <c>null</c> if the message cannot be parsed.</returns>
		public abstract Peers.PeerMessage Parse(RawMessage rawMessage);
	}
}
